<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--作用域插槽-->
<!--子组件给父组件传值-->
<div id="app">
  <cpn></cpn>
  <cpn>
    <template slot-scope="slot">
      <span>{{slot.data.join('*')}}</span>
    </template>
  </cpn>
  <cpn></cpn>
</div>
<template id="cpn">
  <div>
    <slot :data="language">
      <ul>
        <li v-for="item in language">{{item}}</li>
      </ul>
    </slot>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  const cpn = {
    template: '#cpn',
    data() {
      return {
        name: '哈哈哈',
        language: ['海贼王', '小鲤鱼冒险记', '哪吒闹海']
      }
    },
    methods: {
      showMessage() {
        console.log('我是子组件')
      }
    },
    props: {}
  }
  const app = new Vue({
    el: '#app',
    data: {
      message: "你好",
      isShow: true
    },
    components: {
      cpn
    },
    methods: {
      btnClick() {

      }
    }
  })
</script>
</body>
</html>
